package com.myproject.sbp.base.common;

/**
 * 返回枚举
 * @author ywh
 */
public enum RespEnum {

    SUCCESS("200","操作成功"),
    ERROR("400","操作失败"),
    ZUUL_EXCEPTION("500","调用服务异常");

    private String code;
    private String message;

    public static RespEnum get(String code) {
        for (RespEnum e : RespEnum.class.getEnumConstants()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }

    RespEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}